% This file generates Figure 10 in the paper. It runs the .m files below and
% combines the IRFs into a single figure in which each quadrant correspond
% to a different specification of the baseline regression for inflation. 

clear; close all; clc;

global P H;
%% Options for S/LP:

P       =   2;      % Number of lags for endogenous variables.
H       =   9;      % Maximum number of leads.

%%  Including regression dummy. 

run FIG_10_Robustness_Inflation_recession.m;
figure
subplot(2,3,1)
shadedplot(t,irf_slp_baseline_UB',irf_slp_baseline_LB',[0.75,0.75,0.75],'w')
hold on
U       =   plot(t,irf_slp,'x-b',t,irf_slp_zlb,'-r',...
            t,irf_slp_zlb_baseline_LB,'*--r',t,irf_slp_zlb_baseline_UB,'*--r','Linewidth',1.5);
hold on
h = legend(U, 'No ZLB','ZLB','Location','Northwest');
set(h,'Interpreter','latex');
hold on
grid on
title('Including Recession Dummy','Interpreter','latex','fontSize',13);
xlabel('Horizon','Interpreter','latex','fontSize',12);
ylabel('Percent','Interpreter','latex','fontSize',12);
hold on
clearvars -except P H
%%  Growth rates specification.

run FIG_10_Robustness_Inflation_growth.m;

subplot(2,3,2);
shadedplot(t,irf_slp_baseline_UB',irf_slp_baseline_LB',[0.75,0.75,0.75],'w');
hold on
U       =   plot(t,irf_slp,'x-b',t,irf_slp_zlb,'-r',...
            t,irf_slp_zlb_baseline_LB,'*--r',t,irf_slp_zlb_baseline_UB,'*--r','Linewidth',1.5);
h = legend(U, 'No ZLB','ZLB','Location','NorthEast');
set(h,'Interpreter','latex');
hold on
axis([0 8 min(irf_slp_zlb_baseline_LB)-0.2 max(irf_slp_zlb_baseline_UB)+0.2 ]);
grid on
title('Growth Rates Specification','Interpreter','latex','fontSize',13);
xlabel('Horizon','Interpreter','latex','fontSize',12);
ylabel('Percent','Interpreter','latex','fontSize',12);

hold on
%%  Different definition of ZLB. 

run FIG_10_Robustness_Inflation_zlb.m;

subplot(2,3,3);
shadedplot(t,irf_slp_baseline_UB',irf_slp_baseline_LB',[0.75,0.75,0.75],'w')
hold on
U       =   plot(t,irf_slp,'x-b',t,irf_slp_zlb,'-r',...
            t,irf_slp_zlb_baseline_LB,'*--r',t,irf_slp_zlb_baseline_UB,'*--r','Linewidth',1.5);
h = legend(U, 'No ZLB','ZLB','Location','SouthEast');
set(h,'Interpreter','latex')
hold on
axis([0 8 min(irf_slp_zlb_baseline_LB)-0.2 max(irf_slp_zlb_baseline_UB)+0.2 ]);
grid on
title('Alternative ZLB Definition','Interpreter','latex','fontSize',12);
xlabel('Horizon','Interpreter','latex','fontSize',12);
ylabel('Percent','Interpreter','latex','fontSize',12);

hold on
%% Including linear trend. 

run FIG_10_Robustness_Inflation_time_trend.m;

subplot(2,3,4);
shadedplot(t,irf_slp_baseline_UB',irf_slp_baseline_LB',[0.75,0.75,0.75],'w')
hold on
U       =   plot(t,irf_slp,'x-b',t,irf_slp_zlb,'-r',...
            t,irf_slp_zlb_baseline_LB,'*--r',t,irf_slp_zlb_baseline_UB,'*--r','Linewidth',1.5);
h = legend(U, 'No ZLB','ZLB','Location','SouthEast');
set(h,'Interpreter','latex');
hold on
axis([0 8 min(irf_slp_zlb_baseline_LB)-0.2 max(irf_slp_zlb_baseline_UB)+0.2 ]);
grid on
title('Time Trend','Interpreter','latex','fontSize',13);
xlabel('Horizon','Interpreter','latex','fontSize',12);
ylabel('Percent','Interpreter','latex','fontSize',12);

hold on
%% Including quadratic trend. 

run FIG_10_Robustness_Inflation_time_trend_quadratic.m;

subplot(2,3,5)
shadedplot(t,irf_slp_baseline_UB',irf_slp_baseline_LB',[0.75,0.75,0.75],'w')
hold on
U       =   plot(t,irf_slp,'x-b',t,irf_slp_zlb,'-r',...
            t,irf_slp_zlb_baseline_LB,'*--r',t,irf_slp_zlb_baseline_UB,'*--r','Linewidth',1.5);
hold on
h = legend(U, 'No ZLB','ZLB','Location','NorthWest');
set(h,'Interpreter','latex');
hold on
grid on
title('Quadratic Time Trend','Interpreter','latex','fontSize',13);
xlabel('Horizon','Interpreter','latex','fontSize',12);
ylabel('Percent','Interpreter','latex','fontSize',12);
hold on

%% Different lag lengths. 

run FIG_10_Robustness_Inflation_lags.m;

subplot(2,3,6);
shadedplot(t,irf_slp_P_2_UB',irf_slp_P_2_LB',[0.75,0.75,0.75],'w')
hold on
U = plot(t,irf_slp_P_2,'x-k',t,irf_slp_P_3,'o-b',t,irf_slp_P_4,'*-r',t,...
    irf_slp_P_2_zlb,'-k',t,irf_slp_P_3_zlb,'-b',t,irf_slp_P_4_zlb,'-r','Linewidth',1.5);
h = legend(U,'$p=2$','$p=3$','$p=4$','ZLB','Location','NorthWest');
set(h,'Interpreter','latex')
hold on
axis([0 8 min(irf_slp_P_2_LB)-0.2 max(irf_slp_P_2_zlb)+0.2 ]);
grid on
title('Alternative Lags','Interpreter','latex','fontSize',12);
xlabel('Horizon','Interpreter','latex','fontSize',12);
ylabel('Percent','Interpreter','latex','fontSize',12);
hold on
